<?php
if ($this->session->userdata('id') > 0) {
	
	if($account->num_rows() > 0){
		foreach($account->result() as $rows){
			
?>

	<h4 class="d_h4" style="width:92%;">Sign Up Account or <a href="/">Login</a></h4><p style="color:#42C8D1">Please fill all <font color="red">*</font> feilds required !!!</p>
			<p>&nbsp;</p>
            <div class="col col_13" style="
                    padding-left: 206px;
                    padding-right: 152px;
                    border: 1px solid #ccc;
                    margin-top: -23px">
            
            <div id="contact_form">
            <?php
			if(validation_errors() != ""){
			?>
            	<span id="error" style="background: none repeat scroll 0 0 #42C8D1;
    			color: red;
    			float: left;
    			line-height: 23px;
    			padding: 3px;
    			width: 539px;
    			border-radius: 3px;
    ">
    <a href="<?php echo site_url('pages/user_profile'); ?>">
    <img class="error" style="float:right; cursor:pointer;" src="<?php echo site_url(); ?>admin/img/close.gif" />
    </a>
             <?php
                    echo validation_errors(); 
             ?>
             	</span>
              
            <?php
            }
			
				if($this->uri->segment(3) == 'success'){
					?>
		<span id="error" style="background: none repeat scroll 0 0 #42C8D1;
    			color: white;
    			float: left;
    			line-height: 23px;
    			padding: 3px;
    			width: 539px;
    			border-radius: 3px;
                ">Register successfull go to  <a style="color:white" href="<?php echo site_url('pages/user_profile'); ?>"> Profile</a> !!</span>
    <?php
	
				}
            
				echo '<br /><br />';
				echo form_open(site_url('pages/user_update_account'),'POST');
				
				$fullname = array(
						'name' => 'fullname',
						'type' => 'text',
						'placeholder' => 'Your full name...',
						'id' => 'author',
						'required' => '',
						'class' => 'required input_field',
						'autofocus' => '',
						
						'value' => $rows->user_fullName
						);
				$phone = array(
						'name' => 'phone',
						'type' => 'text',
						'placeholder' => 'Your phone number...',
						'id' => 'author',
						'required' => '',
						'class' => 'required input_field',
						'autofocus' => '',
						
						'value' => $rows->user_phone
						);
				$address = array(
						'name' => 'address',
						'type' => 'text',
						'placeholder' => 'Your address...',
						'id' => 'author',
						'required' => '',
						'class' => 'required input_field',
						'autofocus' => '',
						
						'value' => $rows->user_address
						);
			
				$username = array(
						'name' => 'username',
						'type' => 'text',
						'placeholder' => 'Your username...',
						'id' => 'author',
						'required' => '',
						'class' => 'required input_field',
						'autofocus' => '',
						
						'value' => $rows->user_username
						);
			
				
				$gender = array(
						$rows->user_gender => $rows->user_gender,
						'M' => 'Male',
						'F' => 'Female'
						);
				
			
			?>
               
               
                    <label for="author">FullName (<span class="signup">More than 6 characters</span>)<font color="red">*</font>:</label>
                    <?php echo form_input($fullname); ?>
                    <div class="cleaner h10"></div>
                    
                    <label for="author">Gender <font color="red">*</font>:</label>
                     <?php echo form_dropdown('gender',$gender); ?>
                    <div class="cleaner h10"></div>
                    
                    <label for="author">Phone(<span class="signup">Between 9 - 10 numbers</span>)<font color="red">*</font>:</label> 
                     <?php echo form_input($phone); ?>
                    <div class="cleaner h10"></div>
                    
                    <label for="author">Address <font color="red">*</font>:</label> 
                     <?php echo form_input($address); ?>
                    <div class="cleaner h10"></div>
						
                    <label for="email">Email <font color="red">*</font>:</label> 
                    <a>
                    <?php echo $rows->user_email; ?>
                    </a>
                    <div class="cleaner h10"></div>
                    
                    <label for="author">UserName(<span class="signup">More than 6 characters</span>)<font color="red">*</font>:</label> 
                    <?php echo form_input($username); ?>
                    <div class="cleaner h10"></div>
                    
                    
                  	<br />
					<input type="submit" value="Update" id="submit" name="submit" class="submit_btn float_l" />
					<input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_r" />
					
               <?php
			   		echo form_close(); 
			   ?>
            </div>
		</div>
<?php
		}
	}
	
}else{
		redirect(site_url());
	}
?>